package cn.smvc.task.common.service;

import javax.servlet.ServletContext;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import cn.smvc.common.service.Services;

public class RunService {
	
	public void init(ServletContext servletContext) {
		/*
		 * 加载service
		 */
		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
				"applicationContext.xml");
		context.start();
		Services.context = context;
		/*
		 * 启动主线程
		 */
		MainService mainService = new MainService(servletContext);
		mainService.start();
	}

}
